 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 	<head>
		<title>登录</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link rel="stylesheet" type="text/css" href="css/login.css"/>
	</head>
 		
	<body>
		<div id="div_center">
			<div id="div_inputbox">
				<input type="text" id="userName" value="" />
				<input type="password" id="password" />
			</div>
			<input id="btn_img" type="image" src="images/bg_login_btn.jpg" />
		</div>
		<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
		<script type="text/javascript">
			$(function(){
				$("#btn_img").click(function(){
					var aname=$("#userName").val();
					var pwd=$("#password").val();

					if(aname==""){
						alert("用户名不能为空!");
						return;
					}
					if(pwd==""){
						alert("密码不能为空!");
						return;
					}

					$.ajax({
						url:"login",
						type:"post",
						data:{adminName:aname,password:pwd},
						success:function(data){

							if(0==data){
								alert("用户名或密码错误! ");
							}
							else{
								//转向
								window.location.href="main.html";
							}
						}

					});
				});
			});
		</script>
 	 </body>
 		
</html>



